﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;

namespace MyEartags.Hint
{
    public class AllocationAppService : ApplicationService, IAllocationAppService
    {
        private readonly IRepository<Allocation, int> _allocationRepository;

        public AllocationAppService(IRepository<Allocation, int> allocationRepository)
        {
            _allocationRepository = allocationRepository;
        }

        /// <summary>
        /// 待配提示列表
        /// </summary>
        /// <returns></returns>
        public async Task<List<AllocationDto>> GetAllocationList()
        {
            var list = await _allocationRepository.GetListAsync();
            return ObjectMapper.Map<List<Allocation>, List<AllocationDto>>(list);
        }
    }
}
